<?

include("header.inc.php");

?>

  <h1>Create New Account</h1>
  
  <form name="new_user" action="create_user.php" method="post" onsubmit="return validate()">
    <p>
      <label for="email">Email Address:</label><br/>
      <input type="email" name="email" id="email">
    </p>
    <p>
      <label for="password">Password:</label><br/>
      <input type="password" name="password" id="password">
    </p>
    <p>
      <label for="password_check">Re-enter Password:</label><br/>
      <input type="password" name="password_check" id="password_check">
    </p>
    <p>
      <label for="name">Name:</label><br/>
      <input type="text" name="name" id="name">
    </p>
    <p>
      <label for="address">Address:</label><br/>
      <input type="text" name="address" id="address">
    </p>
    <p>
      <label for="phone">Phone Number:</label><br/>
      <input type="text" name="phone" id="phone">
    </p>
    
    <input type="submit" name="action" value="Create Account">
    or
    <a href="index.php">Cancel</a>
  </form>

<script type="text/javascript">
function validate() {
  var form_fields = document.forms['new_user'];
  var email = form_fields['email'].value;
  var pass1 = form_fields['password'].value;
  var pass2 = form_fields['password_check'].value;
  
  if (email == null || email == '') {
    alert('Email address required.');
    return false;
  }
  if (pass1 != pass2) {
    alert('Passwords do not match.');
    return false;
  }
}
</script>

<?

include("footer.inc.php");

?>
